package com.zlx.module_base.base_api.module;

import androidx.lifecycle.LiveData;

import com.zlx.module_base.base_api.res_data.BaseBean;
import com.zlx.module_base.base_api.res_data.ChargeBean;
import com.zlx.module_base.base_api.res_data.HistoryBean;
import com.zlx.module_base.base_api.res_data.MoneyHistoryBean;
import com.zlx.module_base.base_api.res_data.UserAccountListBean;
import com.zlx.module_base.base_api.res_data.WithdrawBody;
import com.zlx.module_base.base_api.res_data.WithdrawComeGoBean;
import com.zlx.module_network.bean.ApiResponse;

import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.POST;
import retrofit2.http.Query;

/**
 * Copyright (C)
 * FileName: ArticleApi
 * Author: Zlx
 * Email: 1170762202@qq.com
 * Date: 2020/9/17 10:48
 * Description: 体系api
 */
public interface MoneyApi {

    /**
     * 钱包明细
     *
     * @return
     */
    @GET("appapi/money/moneyHistory")
    LiveData<ApiResponse<MoneyHistoryBean>> moneyHistory(@Header("token") String token,
                                                         @Query("p") String page
    );

    /**
     * 获取当前充值套餐列表
     *
     * @return
     */
    @GET("appapi/money/getChargeList")
    LiveData<ApiResponse<ChargeBean>> getChargeList(@Header("token") String token
    );

    /**
     * 充值明细
     *
     * @return
     */
    @GET("appapi/money/chargeHistory")
    LiveData<ApiResponse<HistoryBean>> chargeHistory(@Header("token") String token,
                                                     @Query("p") String page
    );

    /**
     * 提现明细
     *
     * @return
     */
    @FormUrlEncoded
    @POST("appapi/money/withdrawComeGo")
    LiveData<ApiResponse<WithdrawComeGoBean>> withdrawComeGo(@Header("token") String token,
                                                             @Field("p") String p
    );

    /**
     * 提现账户列表
     *
     * @return
     */
    @GET("appapi/money/?service=Money.getUserAccountList")
    LiveData<ApiResponse<UserAccountListBean>> getUserAccountList(@Header("token") String token
    );

    /**
     * 删除提现账户
     *
     * @return
     */
    @FormUrlEncoded
    @POST("appapi/money/?service=Money.delUserAccount")
    LiveData<ApiResponse<BaseBean>> delUserAccount(@Header("token") String token,
                                                   @Field("accountId") String accountId
    );

    /**
     * 用户提现
     *
     * @return
     */
    @POST("appapi/money/?service=Money.withdraw")
    LiveData<ApiResponse<BaseBean>> withdraw(@Header("token") String token,
                                             @Body WithdrawBody withdrawBody
    );


}
